package com.ccc.util.dao;

public class UsabilityFunc {

	/**
	 * tongbing
	 * @param args
	 */
	public static void main(String[] args) {
		/*double[] a = {1.0d/25,2d/25,3d/25,4d/25};
		double[] b = {Func2(33d/35),Func2(32d/35),Func2(31d/35),Func2(34d/35)};
		double[] c = {7d/12,8d/12,9d/12,10d/12};
		double[] d = {106d/120,105d/120,110d/120,95d/120};*/
		double[] a = {1.0d/25};
		double[] b = {Func2(33d/35)};
		double[] c = {8d/12};
		double[] d = {95d/120};
		double[] r = {0.3d,0.3d,0.2d,0.2d};
		System.out.println(Func(a,b,c,d,r));
		
	}
	
	public static double Func(double[] a,double[] b,double[] c,double[] d,double[] r){
		double sum = 0; 
		for(int i=0;i<a.length;i++){
			double d1 = Math.pow(a[i], r[0]);
			double d2 = Math.pow(b[i], r[1]);
			double d3 = Math.pow(c[i], r[2]);
			double d4 = Math.pow(d[i], r[3]);
			sum = sum + (d1*d2)*(d3*d4);
		}
		return sum;
	}
	
	public static double Func2(double d){
		return Math.pow(d, -0.11);
	}
}
